﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using WatiN.Core;

namespace ASPItalia.ModelVirtualCasting.WebUI.Test
{
    [TestClass]
    public class WatinTest
    {   
        [TestMethod]
        public void FirstName_Empty_ThrowsError()
        {
            using (IE ie = new IE("http://localhost:39956/ModifyCandidate.aspx?nick=rosetta"))
            {
                ie.Forms[0].TextField(Find.ByValue("Rosa")).Clear();
                ie.Forms[0].Submit();

                var res = ie.Forms[0].Div(Find.ByClass("error")).InnerHtml;
                
                Assert.IsTrue(res.Contains("Il nome è obbligatorio"));
            }
        }
    }
}
